package co.edu.unal.bioingenium.kbmed.mapping.domain;

import co.edu.unal.bioingenium.kbmed.knowledge.vo.DescriptorData;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 *
 * @author  Alejandro Riveros Cruz 
 */
@XmlRootElement
public class TextMapping {

    private long timeMillis;
    private String text;
    private Map<String, List<DescriptorData>> conceptIdenfieds;

    /**
     * 
     */
    public TextMapping() {
    }

    /**
     * 
     * @param text
     */
    public TextMapping(String text) {
        this.text = text;
        timeMillis = System.currentTimeMillis();
    }

    /**
     * 
     * @param timeMillis
     */
    public TextMapping(long timeMillis) {
        this.timeMillis = timeMillis;
    }

    /**
     * 
     * @return
     */
    public Set<String> getSentences() {
        if (conceptIdenfieds != null) {
            return conceptIdenfieds.keySet();
        } else {
            return null;
        }


    }

    /**
     * 
     * @param sentence
     * @return
     */
    public List<DescriptorData> getConceptIdenfieds(String sentence) {
        if (conceptIdenfieds != null && conceptIdenfieds.containsKey(sentence)) {
            return conceptIdenfieds.get(sentence);
        } else {
            return null;
        }
    }

    /**
     * 
     * @param conceptIdenfieds
     */
    public void setConceptIdenfieds(Map<String, List<DescriptorData>> conceptIdenfieds) {
        this.conceptIdenfieds = conceptIdenfieds;
    }

    /**
     * 
     * @return
     */
    public long getTimeMillis() {
        return timeMillis;
    }

    /**
     * 
     * @param timeMillis
     */
    public void setTimeMillis(long timeMillis) {
        this.timeMillis = timeMillis;
    }

    /**
     * 
     * @return
     */
    public String getText() {
        return text;
    }
}
